Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server): user object #598

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat(server): user object #598

wants to merge 3 commits into from

Conversation

mafewtm
Copy link
Member

@mafewtm mafewtm commented Oct 19, 2024

Description

Creates an entry into the users table upon connection. It autoincrements and logs the following identifiers:

  • username
  • license
  • license2
  • fivem
  • discord

Doesn't completely implement #577 yet but this seems like a good starting point that doesn't break anything.

Checklist

  • I have personally loaded this code into an updated Qbox project and checked all of its functionality.
  • My pull request fits the contribution guidelines & code conventions.

Copy link
Member

@Manason Manason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably also need some conversion SQL code to initialize the users table. Consider baking that into server startup to do if the users table is empty.

qbx_core.sql Show resolved Hide resolved
@mafewtm
Copy link
Member Author

mafewtm commented Oct 20, 2024

Probably also need some conversion SQL code to initialize the users table. Consider baking that into server startup to do if the users table is empty.

I'm assuming you mean having it autorun the users table instead of how we have all the resources currently where they run their own sql?

@Manason
Copy link
Member

Manason commented Oct 21, 2024

Probably also need some conversion SQL code to initialize the users table. Consider baking that into server startup to do if the users table is empty.

I'm assuming you mean having it autorun the users table instead of how we have all the resources currently where they run their own sql?

I think so? I just mean running the SQL via lua rather than requiring users to manually run a SQL file to convert things.

@mafewtm
Copy link
Member Author

mafewtm commented Oct 21, 2024

Probably also need some conversion SQL code to initialize the users table. Consider baking that into server startup to do if the users table is empty.

I'm assuming you mean having it autorun the users table instead of how we have all the resources currently where they run their own sql?

I think so? I just mean running the SQL via lua rather than requiring users to manually run a SQL file to convert things.

Well nothing needs to be converted. This is brand new and doesn't change any preexisting code. Nevertheless, I can do it if that's what we wanna do? Should probably do it for all the SQL then if we're gonna do it for this

@Manason
Copy link
Member

Manason commented Oct 22, 2024

Probably also need some conversion SQL code to initialize the users table. Consider baking that into server startup to do if the users table is empty.

I'm assuming you mean having it autorun the users table instead of how we have all the resources currently where they run their own sql?

I think so? I just mean running the SQL via lua rather than requiring users to manually run a SQL file to convert things.

Well nothing needs to be converted. This is brand new and doesn't change any preexisting code. Nevertheless, I can do it if that's what we wanna do? Should probably do it for all the SQL then if we're gonna do it for this

Well, it only gets inserted on connection. So as the code is currently written, this table can't be relied upon to do operations across all users, only ones that have logged in since upgrading.

@mafewtm
Copy link
Member Author

mafewtm commented Oct 22, 2024

Probably also need some conversion SQL code to initialize the users table. Consider baking that into server startup to do if the users table is empty.

I'm assuming you mean having it autorun the users table instead of how we have all the resources currently where they run their own sql?

I think so? I just mean running the SQL via lua rather than requiring users to manually run a SQL file to convert things.

Well nothing needs to be converted. This is brand new and doesn't change any preexisting code. Nevertheless, I can do it if that's what we wanna do? Should probably do it for all the SQL then if we're gonna do it for this

Well, it only gets inserted on connection. So as the code is currently written, this table can't be relied upon to do operations across all users, only ones that have logged in since upgrading.

Correct. That's how it gets the information. We don't have all the information available to fill out so as they login, they get a database entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants